<%@page contentType="text/html; charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>完善公司信息</title>
<!-- begin header 头部 -->
<%@include file="include/header.jsp"%>
<!-- end header -->
</head>
<body>
	<c:set var="company_info_active" value="active" />
	<!-- begin 导航条 -->
	<%@include file="include/nav.jsp"%>
	<!-- end 导航条 -->
	<div class="row">
		<!-- begin菜单 -->
		<%@include file="include/menu.jsp"%>
		<!-- end菜单 -->
		<div class="span9">
			<form action="${contextPath }/innov/updatecompany.do" class="form-horizontal" method="post">
				<div class="control-group">
					<span class="help-block">公司基本信息</span> <label class="control-label"
						for="company_name">公司名称</label>
					<div class="controls">
						<input type="text" class="input-xxlarge" name="namecn" id="company_name"
							placeholder="${company.name }" value="${company.name }"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="company_nameen">公司英文名称</label>
					<div class="controls">
						<input type="text" class="input-xxlarge" name="nameen" id="company_nameen"
							placeholder="${company.nameEn }" value="${company.nameEn }" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="company_description">公司描述</label>
					<div class="controls">
						<input type="text" class="input-xxlarge" name="description" id="company_description"
							placeholder="${company.description }" value="${company.description }" />
					</div>
				</div>
				<input type="hidden" value="${pgIds }" name="pgIds"/>
				<c:forEach items="${company.pgs }" var="pg">
					<span class="help-block">${pg.name }</span>
					<input type="hidden" name="p_value_${pg.id }" value="${pg.name }" />
					<input type="hidden" name="p_paranet_${pg.id }" value="${pg.parentId }"/>
					<c:forEach items="${pg.items }" var="item">
						<c:choose>
							<c:when test="${!empty item.properties }">
								<c:forEach items="${item.properties }" var="property">
									<div class="control-group">
										<label class="control-label" for="p_${property.id }">${property.key
											}</label>
										<div class="controls">
											<input type="text" id="p_${property.id }" name="p_${pg.id }_${item.id}_${property.id}" class="input-xxlarge"
												placeholder="${property.value }" value="${property.value }">
											<input type="hidden" name="p_${pg.id }_${item.id}_${property.id}_v" value="${property.key }" />
										</div>
									</div>
								</c:forEach>
							</c:when>
							<c:otherwise>
								<div class="control-group">
									<label class="control-label" for="item_${item.id }">${item.name
										}</label>
									<div class="controls">
										<input type="text" id="item_${item.id }" name="i_${pg.id }_${item.id}" class="input-xxlarge"
											placeholder="${item.value }" value="${item.value }" />
									</div>
								</div>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:forEach>
				<input type="hidden" value="${configIds }" name="configs"/>
				<c:forEach items="${configs}" var="config">
					<span class="help-block">${config.name }</span>
					<c:choose>
						<c:when test="${!empty config.children }">
							<c:forEach items="${config.children }" var="child">
								<div class="control-group">
									<label class="control-label" for="config_${child.id }">${child.name }</label>
									<div class="controls">
										<input type="text" id="config_${child.id }" name="config_${config.id }_${child.id }" class="input-xxlarge" />
									</div>
								</div>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<div class="control-group">
								<div class="control-group">
									<label class="control-label" for="config_${config.id }">${config.name }</label>
									<div class="control-group">
										<div class="controls">
											<input type="text" id="config_${config.id }" name="config_${config.id }" class="input-xxlarge"  />
										</div>
									</div>
								</div>
							</div>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<input type="submit" class="btn btn-large btn-primary btn-block" value="提交"/>
			</form>
		</div>
	</div>

	<!-- begin foot 依赖-->
	<%@include file="include/foot.jsp"%>
	<!-- end foot 依赖 -->
</body>
</html>